import os
import time


class lgtest(object):
	def lognow(self, msg, logtype, name):
		timel = time.strftime("%Y-%m-%d", time.localtime())
		path = os.path.join(os.getcwd(), 'log') + '/' + name + '_' + timel + '_log.log'
		UID = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
		ms = UID + ' ' + logtype + ' ' + str(msg) + '\n'
		with open(path, 'a') as f:
			f.write(ms)

	@staticmethod
	def staticLognow(msg, log_type, name):
		timel = time.strftime("%Y-%m-%d", time.localtime())
		path = os.path.join(os.getcwd(), 'log')+'/'+name+'_'+timel+'_' + log_type + '.log'
		UID = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
		ms = UID + ' ' + log_type + ' ' + str(msg) + '\n'
		with open(path, 'a') as f:
			f.write(ms)
